package com.soundShape.utils
{
	import flash.filters.BitmapFilterQuality;
	
	import mx.core.UIComponent;
	
	import spark.effects.Animate;
	import spark.effects.AnimateFilter;
	import spark.effects.animation.MotionPath;
	import spark.effects.animation.RepeatBehavior;
	import spark.effects.animation.SimpleMotionPath;
	import spark.filters.DropShadowFilter;
	import spark.filters.GlowFilter;

	public class GlowBug
	{
		
		private static var glowFilter:GlowFilter;
		
		public function GlowBug()
		{
		}
		
		public static function doGlowFilter(target:UIComponent, mode:Boolean):void
		{
			glowFilter = new GlowFilter();
			glowFilter.color = 0xC70001;
			glowFilter.alpha = 0.5
			glowFilter.blurX = 10;
			glowFilter.blurY = 10;
			glowFilter.strength = 1;
			glowFilter.quality = BitmapFilterQuality.LOW;
			glowFilter.inner = false;
			glowFilter.knockout = false;
			
			
			var smp0:SimpleMotionPath = new SimpleMotionPath("alpha",0,1);
			var vec:Vector.<MotionPath> = new Vector.<MotionPath>();
				vec.push(smp0);
			
			var amf:AnimateFilter = new AnimateFilter();
				amf.target = target;
				amf.repeatCount = 6;
				amf.duration = 500;
				amf.repeatBehavior = RepeatBehavior.REVERSE;
				amf.bitmapFilter = glowFilter;
				amf.motionPaths = vec;
				amf.play();
		}
		
	}
}